/**
 * 
 */
package messagetype;

import bot.Client;
import bot.InputLineSegmenter;
import bot.IrcBot;

/**
 * @author Philip
 *
 */
public class NickMessageType implements MessageType {

	@Override
	public void performAction(Client client, IrcBot bot, InputLineSegmenter lineSegmenter) {
		if (lineSegmenter.getSender().equals(bot.getNickName())) {
			if (lineSegmenter.getReceiver().contains(":")) {
				bot.setNickName(lineSegmenter.getReceiver().substring(1));
			} else {
				bot.setNickName(lineSegmenter.getReceiver());
			}
		}
	}
}
